// 定义抽象类Animal
abstract class Animal {
    protected String name;
    protected String species;
    protected String breed;
    protected double price;

    public Animal(String name, String species, String breed, double price) {
        this.name = name;
        this.species = species;
        this.breed = breed;
        this.price = price;
    }

    public abstract void eat();
    public abstract void sleep();
    public abstract void play();
    public abstract void makeSound();
}

// 定义Cat类
class Cat extends Animal {

    public Cat(String name, String breed, double price) {
        super(name, "猫", breed, price);
    }

    @Override
    public void eat() {
        System.out.println(name + " 正在吃猫粮。");
    }

    @Override
    public void sleep() {
        System.out.println(name + " 正在睡觉。");
    }

    @Override
    public void play() {
        System.out.println(name + " 正在玩耍。");
        makeSound();
    }

    @Override
    public void makeSound() {
        System.out.println(name + " 发出了喵喵的叫声。");
    }
}

// 定义Dog类
class Dog extends Animal {

    public Dog(String name, String breed, double price) {
        super(name, "狗", breed, price);
    }

    @Override
    public void eat() {
        System.out.println(name + " 正在吃狗粮。");
    }

    @Override
    public void sleep() {
        System.out.println(name + " 正在睡觉。");
    }

    @Override
    public void play() {
        System.out.println(name + " 正在玩耍。");
    }

    @Override
    public void makeSound() {
        System.out.println(name + " 发出了汪汪的叫声。");
    }
}

// 测试类
public class AnimalTest {
    public static void main(String[] args) {
        // 实例化两只小猫
        Cat cat1 = new Cat("小黑", "英国短毛猫", 2000.0);
        Cat cat2 = new Cat("小白", "波斯猫", 2500.0);

        // 实例化两只小狗
        Dog dog1 = new Dog("小黄", "金毛犬", 3000.0);
        Dog dog2 = new Dog("小灰", "哈士奇", 2800.0);

        // 测试小猫的方法
        cat1.eat();
        cat1.sleep();
        cat1.play();

        cat2.eat();
        cat2.sleep();
        cat2.play();

        // 测试小狗的方法
        dog1.eat();
        dog1.sleep();
        dog1.play();
        dog1.makeSound();

        dog2.eat();
        dog2.sleep();
        dog2.play();
        dog2.makeSound();
    }
}
